<script>
import * as http from "./utils/http";
import config from "./utils/config";
export default {
  onLaunch: function () {
    console.log("App Launch");
    http.wxCode().then((res) => {
      http
        .getOpenid({
          wxCode: res,
          appId: config.appId,
          secret: config.secret,
        })
        .then((res) => {
          console.log(res);
          wx.setStorageSync("openId", res.data.openId);
        });
    });
  },
  onShow: function () {},
  onHide: function () {
    console.log("App Hide");
  },
};
</script>
<style>
page {
  background: #f8f8f8;
  margin: 0;
  padding: 0;
  color: #666666;
  font-size: 28rpx;
}
</style>
<style lang="scss">
/*每个页面公共css */
@import "uview-plus/index.scss";
</style>
